using System;
using System.Collections.Generic;
using System.Text;

namespace Objects
{
    public class DanhSachKhachHang
    {
        #region DanhSachKhachHang variables

        // id khachhang
        private int _Id;

        private String _Ten;
        private String _CMND;
        private String _NgayDangKy;
        private String _NgayNhanThe;
        private String _NgayHetHan;

        private int _TrangThaiDuyet;

        #endregion

        #region DanhSachKhachHang properties

        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }

        public String NgayDangKy
        {
            get { return _NgayDangKy; }
            set { _NgayDangKy = value; }
        }

        public String NgayNhanThe
        {
            get { return _NgayNhanThe; }
            set { _NgayNhanThe = value; }
        }

        public String NgayHetHan
        {
            get { return _NgayHetHan; }
            set { _NgayHetHan = value; }
        }

        public String Ten
        {
            get { return _Ten; }
            set { _Ten = value; }
        }

        public String CMND
        {
            get { return _CMND; }
            set { _CMND = value; }
        }

        public int TrangThaiDuyet
        {
            get { return _TrangThaiDuyet; }
            set { _TrangThaiDuyet = value; }
        }
     

        #endregion

        #region IPopulatable<DanhSachKhachHang> Members

        public DanhSachKhachHang Populate(System.Data.DataRow reader)
        {
            DanhSachKhachHang item = new DanhSachKhachHang();

            try { item.Id = Convert.ToInt32(reader["Id"].ToString()); }
            catch { item.Id = -1; }


            item.NgayDangKy = Convert.ToString(reader["NgayDangKy"].ToString());
            item.NgayNhanThe = Convert.ToString(reader["NgayNhanThe"].ToString());
            item.NgayHetHan = Convert.ToString(reader["NgayHetHan"].ToString());
           
            item.Ten = Convert.ToString(reader["Ten"].ToString());
            item.CMND = Convert.ToString(reader["CMND"].ToString());
            
            item.TrangThaiDuyet = Convert.ToInt32(reader["TrangThaiDuyet"].ToString());

            return item;
        }

        #endregion
    }
}
